import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vant_ui/flutter_vant_ui.dart';
import 'package:vant/src/demos/demos.dart';

class VanDocDemoCellSection extends StatelessWidget {
  const VanDocDemoCellSection({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // appBar: PreferredSize(
      //   preferredSize: const Size.fromHeight(56),
      //   child: AppBar(title: const Text("Cell 单元格")),
      // ),
      appBar: AppBar(title: const Text("Cell 单元格")),
      body: const SingleChildScrollView(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            VanDocDemoBlockTitle(title: "基础用法", paddingTop: 20),
            VanCellGroup(children: [
              VanCell(title: '单元格', value: "内容"),
              VanCell(title: '单元格', value: "内容", label: "描述信息"),
            ]),
            //
            VanDocDemoBlockTitle(title: "卡片风格"),
            VanCellGroup(inset: true, children: [
              VanCell(title: '单元格', value: "内容"),
              VanCell(title: '单元格', value: "内容", label: "描述信息"),
            ]),
            //
            VanDocDemoBlockTitle(title: "单元格大小"),
            VanCellGroup(children: [
              VanCell(title: '单元格', value: "内容", size: VanCellSize.large),
              VanCell(title: '单元格', value: "内容", label: "描述信息", size: VanCellSize.large),
            ]),
            //
            VanDocDemoBlockTitle(title: "展示图标"),
            VanCell(title: "单元格", value: "内容", icon: Icons.location_on_outlined),
            //
            VanDocDemoBlockTitle(title: "展示箭头"),
            VanCellGroup(children: [
              VanCell(title: "单元格", isLink: true),
              VanCell(title: "单元格", value: "内容", isLink: true),
              VanCell(title: "单元格", value: "内容", isLink: true, arrowDirection: VanCellArrowDirection.down),
            ]),
            //
            VanDocDemoBlockTitle(title: "页面导航"),
            VanCellGroup(children: [
              // VanCell(title: 'URL 跳转', url: "https://github.com"),
              VanCell(title: '路由跳转', to: "/index", isLink: true),
            ]),
            // 分组标题
            VanDocDemoBlockTitle(title: "分组标题"),
            VanCellGroup(title: "分组1", children: [
              VanCell(title: '单元格', value: "内容"),
            ]),
            VanCellGroup(title: "分组2", children: [
              VanCell(title: '单元格', value: "内容"),
            ]),
            //
            VanDocDemoBlockTitle(title: "使用插槽"),
            VanCellGroup(children: [
              VanCell(
                  value: "内容",
                  isLink: true,
                  title: Row(children: [
                    Text("单元格"),
                    SizedBox(width: 4),
                    VanTag(type: VanTagType.primary, child: "标签"),
                  ])),
              VanCell(
                title: "单元格",
                value: "内容",
                icon: Icons.shopping_basket,
                rightIcon: Icon(Icons.search),
              )
            ]),
            //
            VanDocDemoBlockTitle(title: "垂直居中"),
            VanCell(title: '单元格', value: "内容", label: "描述信息", center: true),
            //
            SizedBox(height: 40),
          ],
        ),
      ),
    );
  }
}
